UserStatusSelector: set focusPolicy on accept button
authorJyrki Gadinger <nilsding@nilsding.org>
Fri, 21 Feb 2025 09:30:04 +0000 (10:30 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 21 Feb 2025 10:44:32 +0000 (10:44 +0000)
otherwise the status text won't be set on macOS as the text box never
loses its focus

`Qt.StrongFocus` is the default focusPolicy on all platforms except for
macOS, there it's `Qt.TabFocus`

the other buttons of the UserStatusSelector don't need that focusPolicy
as they do not modify the model from values in the view

see also:
- https://bugreports.qt.io/browse/QTBUG-110295
- https://codebrowser.dev/qt6/qtdeclarative/src/quicktemplates/qquickabstractbutton.cpp.html#_ZN27QQuickAbstractButtonPrivate4initEv

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/UserStatusSelector.qml

index 9ce7043d0cea62cd81f899d826796324bb4c0545..15abf6595d8767eba6214bfcf449ed7cea79ce4c 100644 (file)
@@ -341,6 +341,7 @@ ColumnLayout {
             Layout.fillHeight: true
             primary: true
             colored: true
+            focusPolicy: Qt.StrongFocus
             text: qsTr("Set status message")
             onClicked: userStatusSelectorModel.setUserStatus()
         }